<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>宠物那些事 - 宠物爱好者社区论坛</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#4ade80',
                        secondary: '#166534',
                        accent: '#fbbf24',
                        neutral: '#f3f4f6',
                        'neutral-dark': '#374151'
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .text-shadow {
                text-shadow: 0 2px 4px rgba(0,0,0,0.1);
            }
            .card-hover {
                transition: all 0.3s ease;
            }
            .card-hover:hover {
                transform: translateY(-5px);
            }
        }
    </style>
</head>
<body class="bg-gray-50 font-sans text-neutral-dark">
    <!-- 导航栏 -->
    <header class="bg-white shadow-md sticky top-0 z-50">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-2">
                <i class="fa fa-paw text-primary text-3xl"></i>
                <h1 class="text-2xl font-bold text-secondary">宠物那些事</h1>
            </div>
            <nav class="hidden md:flex space-x-6">
    <a href="./pet_forum.html" class="font-medium text-primary transition-colors">论坛首页</a>
    <a href="./features.html" class="font-medium hover:text-primary transition-colors">平台特色</a>
    <a href="./adoption.html" class="font-medium hover:text-primary transition-colors">宠物领养</a>
    <a href="./services.html" class="font-medium hover:text-primary transition-colors">宠物服务</a>
    <a href="./about.html" class="font-medium hover:text-primary transition-colors">关于我们</a>
</nav>
            <div class="flex items-center space-x-4">
                <button class="hidden md:block bg-primary hover:bg-primary/90 text-white px-4 py-2 rounded-full transition-colors">
                    <i class="fa fa-user-plus mr-1"></i> 注册
                </button>
                <button class="md:hidden text-neutral-dark text-xl">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 主要内容区 -->
    <main class="container mx-auto px-4 py-8">
        <!-- 论坛区域 -->
        <section id="forum" class="mb-16">
            <div class="flex flex-col md:flex-row gap-8">
                <!-- 帖子发布区 -->
                <div class="w-full md:w-1/3 bg-white rounded-xl shadow-md p-6">
                    <h2 class="text-xl font-bold mb-4 flex items-center">
                        <i class="fa fa-pencil-square-o text-primary mr-2"></i>发布新帖
                    </h2>
                    <form id="postForm" class="space-y-4">
                        <div>
                            <label for="postTitle" class="block text-sm font-medium text-gray-700 mb-1">标题</label>
                            <input type="text" id="postTitle" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary transition-colors" placeholder="分享你的宠物故事或问题..." required>
                        </div>
                        <div>
                            <label for="postCategory" class="block text-sm font-medium text-gray-700 mb-1">分类</label>
                            <select id="postCategory" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary transition-colors">
                                <option value="discussion">宠物讨论</option>
                                <option value="adoption">宠物领养</option>
                                <option value="health">健康护理</option>
                                <option value="lost">寻宠启事</option>
                                <option value="service">宠物服务</option>
                            </select>
                        </div>
                        <div>
                            <label for="postContent" class="block text-sm font-medium text-gray-700 mb-1">内容</label>
                            <textarea id="postContent" rows="4" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary transition-colors" placeholder="详细描述你的内容..." required></textarea>
                        </div>
                        <div class="flex items-center justify-between">
                            <div class="flex space-x-3">
                                <label class="cursor-pointer">
                                    <i class="fa fa-image text-gray-500 hover:text-primary transition-colors"></i>
                                    <input type="file" class="hidden" accept="image/*">
                                </label>
                                <label class="cursor-pointer">
                                    <i class="fa fa-smile-o text-gray-500 hover:text-primary transition-colors"></i>
                                </label>
                            </div>
                            <button type="submit" class="bg-secondary hover:bg-secondary/90 text-white px-6 py-2 rounded-full transition-colors">
                                发布帖子
                            </button>
                        </div>
                    </form>
                </div>

                <!-- 帖子列表区 -->
                <div class="w-full md:w-2/3">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-2xl font-bold flex items-center">
                            <i class="fa fa-comments text-primary mr-2"></i>最新帖子
                        </h2>
                        <div class="relative">
                            <input type="text" placeholder="搜索帖子..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-full focus:ring-2 focus:ring-primary focus:border-primary transition-colors">
                            <i class="fa fa-search absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
                        </div>
                    </div>

                    <!-- 帖子过滤器 -->
                    <div class="bg-white rounded-xl shadow-sm p-4 mb-6">
                        <div class="flex flex-wrap gap-2">
                            <button class="bg-primary text-white px-4 py-1 rounded-full text-sm">全部</button>
                            <button class="bg-gray-100 hover:bg-gray-200 px-4 py-1 rounded-full text-sm transition-colors">宠物讨论</button>
                            <button class="bg-gray-100 hover:bg-gray-200 px-4 py-1 rounded-full text-sm transition-colors">宠物领养</button>
                            <button class="bg-gray-100 hover:bg-gray-200 px-4 py-1 rounded-full text-sm transition-colors">健康护理</button>
                            <button class="bg-gray-100 hover:bg-gray-200 px-4 py-1 rounded-full text-sm transition-colors">寻宠启事</button>
                            <button class="bg-gray-100 hover:bg-gray-200 px-4 py-1 rounded-full text-sm transition-colors">宠物服务</button>
                        </div>
                    </div>

                    <!-- 帖子列表 -->
                    <div id="postsContainer" class="space-y-4">
                        <!-- 帖子卡片1 -->
                        <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                            <div class="p-6">
                                <div class="flex justify-between items-start mb-4">
                                    <div class="flex items-center space-x-3">
                                        <img src="https://picsum.photos/id/237/40/40" alt="用户头像" class="w-10 h-10 rounded-full object-cover">
                                        <div>
                                            <h3 class="font-semibold">铲屎官小明</h3>
                                            <p class="text-xs text-gray-500">2小时前</p>
                                        </div>
                                    </div>
                                    <span class="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full">宠物讨论</span>
                                </div>
                                <h3 class="text-lg font-bold mb-2">我家猫咪总是乱尿怎么办？</h3>
                                <p class="text-gray-600 mb-4 line-clamp-2">最近刚搬家，我家猫咪总是在沙发上乱尿，试过很多方法都没用，有没有有经验的铲屎官可以支支招？</p>
                                <div class="flex justify-between items-center">
                                    <div class="flex space-x-4 text-gray-500">
                                        <button class="flex items-center hover:text-primary transition-colors">
                                            <i class="fa fa-thumbs-o-up mr-1"></i> 24
                                        </button>
                                        <button class="flex items-center hover:text-primary transition-colors">
                                            <i class="fa fa-comment-o mr-1"></i> 8
                                        </button>
                                        <button class="flex items-center hover:text-primary transition-colors">
                                            <i class="fa fa-share-alt mr-1"></i> 分享
                                        </button>
                                    </div>
                                    <button class="text-gray-400 hover:text-gray-600 transition-colors">
                                        <i class="fa fa-ellipsis-h"></i>
                                    </button>
                                </div>
                            </div>
                        </div>

                        <!-- 帖子卡片2 -->
                        <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                            <div class="p-6">
                                <div class="flex justify-between items-start mb-4">
                                    <div class="flex items-center space-x-3">
                                        <img src="https://picsum.photos/id/1025/40/40" alt="用户头像" class="w-10 h-10 rounded-full object-cover">
                                        <div>
                                            <h3 class="font-semibold">爱宠人士</h3>
                                            <p class="text-xs text-gray-500">昨天 15:30</p>
                                        </div>
                                    </div>
                                    <span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">宠物领养</span>
                                </div>
                                <h3 class="text-lg font-bold mb-2">可爱金毛寻主人，坐标北京</h3>
                                <p class="text-gray-600 mb-4 line-clamp-2">朋友因工作调动无法继续养，一岁大的金毛，非常温顺听话，已打疫苗，希望能给它找个有爱心的新家。</p>
                                <div class="flex justify-between items-center">
                                    <div class="flex space-x-4 text-gray-500">
                                        <button class="flex items-center hover:text-primary transition-colors">
                                            <i class="fa fa-thumbs-o-up mr-1"></i> 56
                                        </button>
                                        <button class="flex items-center hover:text-primary transition-colors">
                                            <i class="fa fa-comment-o mr-1"></i> 23
                                        </button>
                                        <button class="flex items-center hover:text-primary transition-colors">
                                            <i class="fa fa-share-alt mr-1"></i> 分享
                                        </button>
                                    </div>
                                    <button class="text-gray-400 hover:text-gray-600 transition-colors">
                                        <i class="fa fa-ellipsis-h"></i>
                                    </button>
                                </div>
                            </div>
                        </div>

                        <!-- 帖子卡片3 -->
                        <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                            <div class="p-6">
                                <div class="flex justify-between items-start mb-4">
                                    <div class="flex items-center space-x-3">
                                        <img src="https://picsum.photos/id/1062/40/40" alt="用户头像" class="w-10 h-10 rounded-full object-cover">
                                        <div>
                                            <h3 class="font-semibold">宠物医生小李</h3>
                                            <p class="text-xs text-gray-500">3天前</p>
                                        </div>
                                    </div>
                                    <span class="bg-purple-100 text-purple-800 text-xs px-2 py-1 rounded-full">健康护理</span>
                                </div>
                                <h3 class="text-lg font-bold mb-2">夏季宠物防暑指南，这些要点要注意！</h3>
                                <p class="text-gray-600 mb-4 line-clamp-2">随着气温升高，宠物中暑风险增加。本文总结了夏季宠物防暑的几个关键点，帮助大家让毛孩子安全度夏。</p>
                                <div class="flex justify-between items-center">
                                    <div class="flex space-x-4 text-gray-500">
                                        <button class="flex items-center hover:text-primary transition-colors">
                                            <i class="fa fa-thumbs-o-up mr-1"></i> 128
                                        </button>
                                        <button class="flex items-center hover:text-primary transition-colors">
                                            <i class="fa fa-comment-o mr-1"></i> 45
                                        </button>
                                        <button class="flex items-center hover:text-primary transition-colors">
                                            <i class="fa fa-share-alt mr-1"></i> 分享
                                        </button>
                                    </div>
                                    <button class="text-gray-400 hover:text-gray-600 transition-colors">
                                        <i class="fa fa-ellipsis-h"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 加载更多 -->
                    <div class="mt-8 text-center">
                        <button id="loadMoreBtn" class="border border-primary text-primary hover:bg-primary hover:text-white px-6 py-2 rounded-full transition-colors">
                            加载更多帖子
                        </button>
                    </div>
                </div>
            </div>
        </section>

        <!-- 平台特色 -->
        <section id="features" class="mb-16">
            <h2 class="text-3xl font-bold text-center mb-12 text-shadow">平台特色</h2>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <div class="bg-white rounded-xl shadow-md p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fa fa-comments text-2xl text-secondary"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">问答和求助</h3>
                    <p class="text-gray-600">如果您对养宠的某些问题感到困惑，您可以向其他宠物爱好者们寻求帮助和建议！</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fa fa-heart text-2xl text-blue-600"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">宠物领养</h3>
                    <p class="text-gray-600">如果您想找到一个您喜欢的小可爱，我们提供安全可靠的宠物领养渠道，让每个生命都有温暖的家。</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-yellow-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fa fa-home text-2xl text-yellow-600"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">宠物托管</h3>
                    <p class="text-gray-600">如果您发现没有足够的时间照顾小可爱，我们提供专业的宠物托管服务，让您外出无忧。</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fa fa-truck text-2xl text-purple-600"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">宠物托运</h3>
                    <p class="text-gray-600">如果您要带小可爱去另外一个地方，我们提供安全舒适的宠物托运服务，让旅途更安心。</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fa fa-search text-2xl text-red-600"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">寻宠启事</h3>
                    <p class="text-gray-600">如果您发现找不到小可爱，我们提供寻宠启事发布平台，帮助您尽快找回您的毛孩子。</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fa fa-user text-2xl text-indigo-600"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">宠托师</h3>
                    <p class="text-gray-600">如果您想照顾更多小可爱，您可以成为我们的宠托师，用爱心和专业服务赚取收入。</p>
                </div>
            </div>
        </section>
    </main>

    <!-- 页脚 -->
    <footer class="bg-secondary text-white py-12">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <div class="flex items-center space-x-2 mb-4">
                        <i class="fa fa-paw text-primary text-2xl"></i>
                        <h3 class="text-xl font-bold">宠物那些事</h3>
                    </div>
                    <p class="text-gray-300 mb-4">和万千宠物爱好者一起养宠，互相协助，一起避坑，让养宠更有乐趣！</p>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-300 hover:text-primary transition-colors"><i class="fa fa-weixin text-xl"></i></a>
                        <a href="#" class="text-gray-300 hover:text-primary transition-colors"><i class="fa fa-weibo text-xl"></i></a>
                        <a href="#" class="text-gray-300 hover:text-primary transition-colors"><i class="fa fa-instagram text-xl"></i></a>
                    </div>
                </div>
                <div>
                    <h4 class="text-lg font-semibold mb-4">快速链接</h4>
                    <ul class="space-y-2">
                        <li><a href="#forum" class="text-gray-300 hover:text-primary transition-colors">论坛首页</a></li>
                        <li><a href="#features" class="text-gray-300 hover:text-primary transition-colors">平台特色</a></li>
                        <li><a href="#adopt" class="text-gray-300 hover:text-primary transition-colors">宠物领养</a></li>
                        <li><a href="#services" class="text-gray-300 hover:text-primary transition-colors">宠物服务</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="text-lg font-semibold mb-4">帮助中心</h4>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-gray-300 hover:text-primary transition-colors">新手指南</a></li>
                        <li><a href="#" class="text-gray-300 hover:text-primary transition-colors">常见问题</a></li>
                        <li><a href="#" class="text-gray-300 hover:text-primary transition-colors">联系我们</a></li>
                        <li><a href="#" class="text-gray-300 hover:text-primary transition-colors">用户协议</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="text-lg font-semibold mb-4">责任和使命</h4>
                    <p class="text-gray-300">倡导热爱自然，爱护动物，做一个动物保护主义者。让每个宠物都能得到关爱和尊重。</p>
                </div>
            </div>
            <div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
                <p>&copy; 2023 宠物那些事 - 宠物爱好者社区论坛 版权所有</p>
            </div>
        </div>
    </footer>

    <!-- JavaScript -->
    <script>
        // 帖子发布功能
        document.getElementById('postForm').addEventListener('submit', function(e) {
            e.preventDefault();
            
            // 获取表单数据
            const title = document.getElementById('postTitle').value;
            const category = document.getElementById('postCategory').value;
            const content = document.getElementById('postContent').value;
            
            // 简单验证
            if (!title || !content) {
                alert('请填写标题和内容');
                return;
            }
            
            // 获取分类显示文本和样式
            let categoryText, categoryClass;
            switch(category) {
                case 'discussion':
                    categoryText = '宠物讨论';
                    categoryClass = 'bg-blue-100 text-blue-800';
                    break;
                case 'adoption':
                    categoryText = '宠物领养';
                    categoryClass = 'bg-green-100 text-green-800';
                    break;
                case 'health':
                    categoryText = '健康护理';
                    categoryClass = 'bg-purple-100 text-purple-800';
                    break;
                case 'lost':
                    categoryText = '寻宠启事';
                    categoryClass = 'bg-red-100 text-red-800';
                    break;
                case 'service':
                    categoryText = '宠物服务';
                    categoryClass = 'bg-yellow-100 text-yellow-800';
                    break;
                default:
                    categoryText = '宠物讨论';
                    categoryClass = 'bg-blue-100 text-blue-800';
            }
            
            // 创建新帖子元素
            const postCard = document.createElement('div');
            postCard.className = 'bg-white rounded-xl shadow-md overflow-hidden card-hover';
            postCard.innerHTML = `
                <div class="p-6">
                    <div class="flex justify-between items-start mb-4">
                        <div class="flex items-center space-x-3">
                            <img src="https://picsum.photos/seed/${Math.random()}/40/40" alt="用户头像" class="w-10 h-10 rounded-full object-cover">
                            <div>
                                <h3 class="font-semibold">我</h3>
                                <p class="text-xs text-gray-500">刚刚</p>
                            </div>
                        </div>
                        <span class="${categoryClass} text-xs px-2 py-1 rounded-full">${categoryText}</span>
                    </div>
                    <h3 class="text-lg font-bold mb-2">${title}</h3>
                    <p class="text-gray-600 mb-4 line-clamp-2">${content}</p>
                    <div class="flex justify-between items-center">
                        <div class="flex space-x-4 text-gray-500">
                            <button class="flex items-center hover:text-primary transition-colors">
                                <i class="fa fa-thumbs-o-up mr-1"></i> 0
                            </button>
                            <button class="flex items-center hover:text-primary transition-colors">
                                <i class="fa fa-comment-o mr-1"></i> 0
                            </button>
                            <button class="flex items-center hover:text-primary transition-colors">
                                <i class="fa fa-share-alt mr-1"></i> 分享
                            </button>
                        </div>
                        <button class="text-gray-400 hover:text-gray-600 transition-colors">
                            <i class="fa fa-ellipsis-h"></i>
                        </button>
                    </div>
                </div>
            `;
            
            // 添加到帖子列表顶部
            const postsContainer = document.getElementById('postsContainer');
            postsContainer.insertBefore(postCard, postsContainer.firstChild);
            
            // 清空表单
            this.reset();
            
            // 显示成功提示
            alert('帖子发布成功！');
        });

        // 加载更多帖子功能
        document.getElementById('loadMoreBtn').addEventListener('click', function() {
            this.innerHTML = '<i class="fa fa-spinner fa-spin mr-2"></i> 加载中...';
            
            // 模拟加载延迟
            setTimeout(() => {
                // 恢复按钮文本
                this.innerHTML = '加载更多帖子';
                
                // 显示没有更多帖子提示
                alert('没有更多帖子了');
            }, 1500);
        });

        // 平滑滚动
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
    </script>
</body>
</html>